//
//  UIView+LYExtension.h
//  LYExtension
//
//  Created by cqck on 2021/12/1.
//

#import <UIKit/UIKit.h>

typedef NS_OPTIONS(NSUInteger, UIBorderSideType) {
    UIBorderSideTypeAll  = 0,
    UIBorderSideTypeTop = 1 << 0,
    UIBorderSideTypeBottom = 1 << 1,
    UIBorderSideTypeLeft = 1 << 2,
    UIBorderSideTypeRight = 1 << 3,
};

typedef NS_ENUM(NSInteger, UICornerPosition) {
    UICornerPositionTop,
    UICornerPositionLeft,
    UICornerPositionBottom,
    UICornerPositionRight,
    UICornerPositionAll,
    UICornerPositionTopLeft,
};

@interface UIView (LYExtension)

/**
 @brief 生成箭头向下的三角形视图(背景颜色默认白色)

 @param color 三角形内部填充颜色
 */
+ (UIView *)lyInitTriangleViewWithColor:(UIColor *)color;

+ (UIView *)lyCorner:(CGFloat)cornerValue type:(UICornerPosition)type;

/**
 @brief 设置UIView边框

 @param color 边框颜色
 @param borderWidth 边框宽度
 @param borderType 设置边框范围
 */
- (UIView *)borderForColor:(UIColor *)color borderWidth:(CGFloat)borderWidth borderType:(UIBorderSideType)borderType;

/**
 @brief 设置UIView边框

 @param color 边框颜色
 @param borderWidth 边框宽度
 @param borderType 设置边框范围
 @param size 尺寸
 */
- (UIView *)borderForColor:(UIColor *)color borderWidth:(CGFloat)borderWidth borderType:(UIBorderSideType)borderType viewSize:(CGSize)size;

@end
